﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation = "false" CodeFile="Store.aspx.cs" Inherits="Manage_basisset_Store" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>店铺管理</title>
    <link rel="stylesheet" type="text/css" href="../skin/css/base.css" />
    <script language="javascript" type="text/javascript">
        function selectall() {
            if (document.getElementById("chkSelect").checked == true) {
                v = true;
            }
            else {
                v = false;
            }
            var f = document.forms[0];
            for (i = 0; i < f.elements.length; i++)
                f.elements[i].checked = v;
        }
        function checkForm() {
            
            var ccode = document.getElementById("txtcode");
           
            if (ccode.value.length == 0) {
                alert("店铺编号不能为空！");
                ccode.focus();
                return false;
            }

        }
      
    </script>
    <style type="text/css">
        .cinputedit
        {
            border: solid 1px green;
        }
        .cinput
        {
            border: none;
        }
        .style1
        {
            width: 806px;
        }
    </style>
</head>
<body leftmargin="8" topmargin="8" background='../skin/images/allbg.gif'>
    <form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server"  EnableScriptGlobalization="True" EnableScriptLocalization="True">
        </asp:ScriptManager>
   <!--  快速转换位置按钮  -->
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
        <tr>
            <td height="26" background="../skin/images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                       <td align="center"><span style="font-size:14px; font-weight:bold">店铺</span></td>
                      
                        <td  align="right"  style="width:80px">
                            <asp:Button ID="addStore" runat="server" class="coolbg"  Text="添加店铺" OnClick="addStore_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
     <asp:UpdatePanel ID="up1" runat="server" >
    <ContentTemplate>
    <table id="tbladdStore" runat="server" width="98%" border="0" cellpadding="2" cellspacing="1"
        bgcolor="#D1DDAA" align="center" style="margin-top: 8px; display: none">
        <tbody style="width: 100%">
            <tr bgcolor="#E7E7E7">
                <td height="24" colspan="7" background="../skin/images/tbg.gif">
                    <div align="left" class="STYLE4">
                        添加店铺</div>
                </td>
            </tr>
            <tr align='center' style="width: 100%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';"
                onmouseout="javascript:this.bgColor='#FFFFFF';" height="22">
                 <td width="13%" align="left">
                    店铺编号：
                </td>
                <td width="25%" align="left">
                    <asp:TextBox ID="txtcode" runat="server" Width="268px"></asp:TextBox>
                </td>
                <td width="13%" align="left">
                    店铺名称：
                </td>
                <td width="25%" align="left">
                    <asp:TextBox ID="txtname" runat="server" Width="268px"></asp:TextBox>
                </td>
                
                <td width="25%" align="left" colspan="3">
                    <asp:Button ID="btnSave" runat="server" Text="保存" OnClientClick="return checkForm();false"
                        OnClick="btnSave_Click" />
                </td>
            </tr>
        </tbody>
    </table>
          <div  style=" text-align:center">
            <input type='hidden' name='dopost' value='' />
            <table width='98%'  border='0' cellpadding='1' cellspacing='1' bgcolor='#CBD8AC' align="center" style="margin-top:8px">
              <tr bgcolor='#EEF4EA'>
                <td background='skin/images/wbg.gif' align='center'>
                  <table border='0' cellpadding='0' cellspacing='0'>
                    <tr>
                    <td width='70'>
                      关键字：
                    </td>
                    <td width='160'>
                        <asp:TextBox ID="txtkeyword" runat="server" Width="150px"></asp:TextBox>
                    </td>
                     
                    <td width="100px">
                <asp:ImageButton ID="ibtnsearch" runat="server" Width="45px" Height="20px" 
                            BorderStyle="None"  CssClass="np"  ImageUrl="../skin/images/frame/search.gif" 
                            onclick="ibtnsearch_Click"  />
                     
                    </td>
                      
                    <td>
              
                    </td>
                   </tr>
                  </table>
                </td>
              </tr>
            </table>
            </div>
    <!--  内容列表   -->
    <div id="form2">
  
    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
   <asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
   <ContentTemplate>
  
    <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td height="24" colspan="4" background="../skin/images/tbg.gif">&nbsp;店铺列表&nbsp;&nbsp;
                    <asp:FileUpload ID="fuExcel" runat="server" ToolTip="选择Excel文件" Height="18px" 
                        Width="381px"  />
                    &nbsp;&nbsp;
                    <asp:Button class="coolbg" ID="btnInput"  
                        runat="server" Text="从Excel导入" onclick="btnInput_Click"   />&nbsp;&nbsp;  <asp:Button ID="btnexport" runat="server"     Text="导出Excel" onclick="btnexport_Click" />&nbsp;
                       
                        <a href='<%=ConfigHelper.ExcelModelPath+"店铺.xls" %>' target="_blank" >查看Excel模板</a>
                        </td>
    </tr>
     </ContentTemplate>
     <Triggers><asp:PostBackTrigger ControlID="btnInput" />
     </Triggers>
   </asp:UpdatePanel>
    <tr style="background-color:#ffffff">
    <td >
          <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False"  OnRowCancelingEdit="GridView1_RowCancelingEdit"
                            OnRowEditing="GridView1_RowEditing" 
              OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting"
                            DataKeyNames="StoreId"  DataMember="Name" SelectedIndex="0" 
              OnRowDataBound="GridView1_RowDataBound" GridLines="Both" 
              AllowPaging="False" PageIndex="1" AllowSorting="true" 
              onsorting="GridView1_Sorting" 
           
              >
                            <Columns>
                                <asp:TemplateField HeaderText="选择">
                                    <ItemTemplate>
                                          <asp:CheckBox ID="chkID" runat="server" />
                                          <asp:HiddenField ID="hdfStoreId" runat="server" Value='<%#Eval("StoreId") %>' />
                                    </ItemTemplate>
                                    
                                    <ItemStyle width="40px" HorizontalAlign="Center"/>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="店铺编号" SortExpression="Code">
                                    <ItemTemplate>
                                          <asp:Label ID="lblcode" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtCode" Text='<%# Eval("Code") %>' runat="server" Width="140px" />
                                    </EditItemTemplate>
                                    
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="店铺名称" SortExpression="Name">
                                    <ItemTemplate>
                                           <asp:Label ID="lblname" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtName" Text='<%# Eval("Name") %>' runat="server" Width="140px" />
                                    </EditItemTemplate>
                                   
                                </asp:TemplateField>
                                 
                                <asp:CommandField   HeaderText="操作"  ItemStyle-HorizontalAlign="Center"  />
                            </Columns>
                            <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF"  ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF"  ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                            
                        </asp:GridView>
   </td>
   </tr>
    <tr bgcolor="#FAFAF1">
    <td height="28"  style=" padding-left:14px">
	    <asp:CheckBox ID="selectAll" runat="server"  Text="全选" 
            oncheckedchanged="selectAll_CheckedChanged" Enabled="false" AutoPostBack="true" />&nbsp;
          <asp:Button class="coolbg" Enabled="false" ID="btnDeleteMass" OnClientClick="return confirm('你确定要删除选择记录吗?');" runat="server"
                          Text="批量删除"  OnClick="btnDeleteMass_Click"/>
    </td>
    </tr>
     <tr align="right" bgcolor="#EEF4EA">
                <td height="36" align="center">
                    <webdiyer:AspNetPager ID="pager1" runat="server" OnPageChanged="pager1_PageChanged"
                        PageSize="20">
                    </webdiyer:AspNetPager>
                </td>
            </tr>
    </table>
     
  </div>
  </ContentTemplate>
     <Triggers><asp:PostBackTrigger ControlID="btnexport" /></Triggers>
    </asp:UpdatePanel>
    </form>
</body>
</html>
